import  pymysql;

# 连接数据库
connect = pymysql.Connect(
    host='localhost',
    port=3306,
    user='root',
    passwd='123456',
    db='finance',
    charset='utf8'
)

# 获取游标
cursor = connect.cursor()

# 查询数据
sql = "SELECT a.* FROM sys_user a  "
cursor.execute(sql)
for row in cursor.fetchall():
    print("Name:", row[1])
print('共查找出', cursor.rowcount, '条数据')


for x in range(1,10):
    for y in range(0,10):
           if x<y:
               print(x*10+y)



s = set(['Adam', 'Lisa', 'Paul'])
L = ['Adam', 'Lisa', 'Bart', 'Paul']
for a in L:
    if a in s:
        s.remove(a);
    else:
        s.add(a);
print(s)


def square_of_sum(L):
    return sum([x**2 for x in L])
print(square_of_sum([1, 2, 3, 4, 5]))
print(square_of_sum([-5, 0, 5, 15, 25]))

for x in range(1,101):
    if x%7==0:
        print(x)

